//
//  StatusDetailView.m
//  Weibo
//
//  Created by Anasue on 9/16/15.
//  Copyright (c) 2015 Anasue. All rights reserved.
//

#import "StatusDetailView.h"
#import "StatusOriginalView.h"
#import "StatusRetweetedView.h"
#import "StatusFrame.h"
#import "StatusDetailViewFrame.h"

@interface StatusDetailView ()
@property (nonatomic, strong) StatusOriginalView *originalView;
@property (nonatomic, strong) StatusRetweetedView *retweetedView;
@end

@implementation StatusDetailView

- (id)initWithFrame:(CGRect)frame
{
    if (self = [super initWithFrame:frame]){
        self.userInteractionEnabled = YES;
        self.image = [UIImage resizeImage:@"timeline_card_top_background"];
        //创建原创微博
        [self setupStatusOriginalView];
        //创建转发微博
        [self setupStatusRetweetedView];
    }
    return self;    
}

/**
 *  创建原创微博
 */
- (void)setupStatusOriginalView
{
    StatusOriginalView *originalView = [[StatusOriginalView alloc]init];
    [self addSubview:originalView];
    self.originalView = originalView;
}

/**
 *  创建转发微博
 */
- (void)setupStatusRetweetedView
{
    StatusRetweetedView *retweetedView = [[StatusRetweetedView alloc]init];
    [self addSubview:retweetedView];
    self.retweetedView = retweetedView;
}

- (void)setDetailViewFrame:(StatusDetailViewFrame *)detailViewFrame
{
    _detailViewFrame = detailViewFrame;
    self.frame = detailViewFrame.frame;
    
    self.originalView.originalViewFrame = detailViewFrame.originalViewFrame;
    self.retweetedView.retweetedViewFrame = detailViewFrame.retweetedViewFrame;
}

@end
